// Code file original author: Martin Lapierre, http://devinstinct.com

using System;
using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;

namespace EntLibContrib.Validation.Validators
{
    /// <summary>
    /// Performs validation on objects by applying the 
    /// validation rules specified for the given type-parameter.
    /// </summary>
    /// <remarks>
    /// Same as <see cref="ObjectValidator"/>, but no need of typeof.
    /// </remarks>
    /// <typeparam name="T">The target type.</typeparam>
    public class ObjectValidator<T>
        : ObjectValidator
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance <see cref="ObjectValidator{T}">.
        /// </summary>
        public ObjectValidator()
            : base(typeof(T))
        {
        }

        /// <summary>
        /// Initializes a new instance <see cref="ObjectValidator{T}"> using the supplied ruleset.
        /// </summary>
        /// <param name="targetRuleset">The ruleset to use.</param>
        public ObjectValidator(string targetRuleset)
            : base(typeof(T), targetRuleset)
        {
        }

        #endregion Constructors
    }
}
